package com.codingxyz.simple;

public class TransferValue {


    public static void main(String[] args) {

        Integer age = 40;

        TransferValue t = new TransferValue();
        t.setAge(age);
        System.out.println("int set age : "+age);

        Person person = new Person("xxx");
        t.setPersonName(person);
        System.out.println("object : "+person.getName());

        String str = "xxx";

        t.setString(str);


        System.out.println("str : "+str);



    }


    public void setAge(Integer age){

        age = 30;

    }

    public void setPersonName(Person person){
        person.setName("11111");
    }


    public void setString(String str){
        str="abc";
    }

}

class  Person{

    private String name;

    public Person(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
